#ifndef SD_ERRCODE_H_00138F8F2E70_200806111932
#define SD_ERRCODE_H_00138F8F2E70_200806111932

#ifdef __cplusplus
extern "C" 
{
#endif


#define SUCCESS							(0)
#define FAIL                            (-1)

#define SD_ERR_CODE_RESERVE  (0x0FFFFFFF)

/* preserved for os */


/* use defined: */

/***************************************************************************/
/* common error */
/***************************************************************************/
#define COMMON_ERRCODE_BASE				(1024)

#define OUT_OF_MEMORY			(COMMON_ERRCODE_BASE + 1)
#define INVALID_MEMORY			(COMMON_ERRCODE_BASE + 2)
#define INVALID_SSLAB_SIZE		(COMMON_ERRCODE_BASE + 3)
#define TOO_FEW_MPAGE			(COMMON_ERRCODE_BASE + 4)
#define INVALID_HANDLER		(COMMON_ERRCODE_BASE + 5)

#define OUT_OF_FIXED_MEMORY		(COMMON_ERRCODE_BASE + 10)

#define	QUEUE_NO_ROOM			(COMMON_ERRCODE_BASE + 100)
#define QUEUE_IS_EMPTY          (COMMON_ERRCODE_BASE + 101)
    
#define LOCK_SHAREBRD_FAILED	(COMMON_ERRCODE_BASE + 150)

#define MAP_UNINIT				(COMMON_ERRCODE_BASE + 200)
#define MAP_DUPLICATE_KEY		(COMMON_ERRCODE_BASE + 250)
#define MAP_KEY_NOT_FOUND		(COMMON_ERRCODE_BASE + 300)

#define INVALID_ITERATOR		(COMMON_ERRCODE_BASE + 350)

#define BUFFER_OVERFLOW			(COMMON_ERRCODE_BASE + 400)

#define	BITMAP_BITSIZE_OVERFLOW	(COMMON_ERRCODE_BASE + 500)

#define INVALID_ARGUMENT		(COMMON_ERRCODE_BASE + 600)

#define NOT_FOUND_MAC_ADDR	        (COMMON_ERRCODE_BASE + 700)
#define GETTING_IMEI_ADDR	        (COMMON_ERRCODE_BASE + 701)
#define NETWORK_NOT_READY	        (COMMON_ERRCODE_BASE + 702)
#define USER_ABORT_NETWORK	        (COMMON_ERRCODE_BASE + 703)
#define NEED_RECONNECT_NETWORK	        (COMMON_ERRCODE_BASE + 704)
#define NETWORK_INITIATING	        (COMMON_ERRCODE_BASE + 705)
#define INVALID_SOCKET_DESCRIPTOR	(COMMON_ERRCODE_BASE + 710)

#define ERROR_LOG_CONF_FILE		(COMMON_ERRCODE_BASE + 800)

#define ERROR_INVALID_INADDR	(COMMON_ERRCODE_BASE + 900)
#define ERROR_INVALID_PEER_ID	(COMMON_ERRCODE_BASE + 901)
#define ERROR_WAIT_NOTIFY		(COMMON_ERRCODE_BASE + 902)
#define ERROR_DATA_IS_WRITTING (COMMON_ERRCODE_BASE + 903)

               

/***************************************************************************/
/* socket error */
/***************************************************************************/
    
#define SOCKET_ERRCODE_BASE				(1024*2)
    
#define SOCKET_INIT_FAIL                (SOCKET_ERRCODE_BASE+1)
#define SOCKET_SET_OPTION               (SOCKET_ERRCODE_BASE+2)
#define SOCKET_BIND_FAIL                (SOCKET_ERRCODE_BASE+3)
    
    
/***************************************************************************/
/* KNX error */
/***************************************************************************/
    
#define EIB_ERR_CODE_BASE				(1024*10)
#define EIB_NO_MATCH_CMD                (EIB_ERR_CODE_BASE+1)
#define EIB_INVALID_SERVER_INFO         (EIB_ERR_CODE_BASE+2)
    
    
/*
    KNX error
 */
    
#define KNX_ERROR_CODE_BASE             (EIB_ERR_CODE_BASE + 100)
#define KNX_HEART_BEAT                  (KNX_ERROR_CODE_BASE+1)
#define KNX_NONE_TUNNELLING_ACK         (KNX_ERROR_CODE_BASE+2)
    
#ifdef __cplusplus
}
#endif

#endif
